package com.itheima.stock.mapper;

import com.itheima.stock.entity.StockRtInfo;
import com.itheima.stock.vo.*;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.List;


/**
 * @author 28188
 */
@Mapper
public interface StockRtInfoMapper {

    List<StockRtInfo> stockIncreaseLimit(LocalDateTime curDateTime);

    List<IncreaseVO> selectAll();

    List<OptionVO> upDownCount(@Param("openTime") LocalDateTime openTime, @Param("curDateTime") LocalDateTime curDateTime, @Param("flag") int i);
    
    List<UpDownAreaVO.DomainInfo> stockUpDownScopeCount(@Param("avlDate") LocalDateTime avlDate);

    List<Stock4MinuteDomain> stockScreenTimeSharing(@Param("stockCode") String code, @Param("openDateTime") LocalDateTime openDateTime, @Param("curDateTime") LocalDateTime curDateTime);

    /**
     * 获取指定日期范围内的收盘价格
     * @param code 股票编码
     * @param beginDate 起始时间
     * @param endDate 结束时间
     * @return
     */
    List<LocalDateTime> getCloseDates(@Param("code") String code, @Param("beginDate") LocalDateTime beginDate, @Param("endDate") LocalDateTime endDate);

    /**
     * 获取指定股票在指定日期下的数据
     * @param code 股票编码
     * @param dates 指定日期集合
     * @return
     */
    List<Stock4EvrDayDomain> getStockCreenDkLineData(@Param("code") String code, @Param("dates") List<LocalDateTime> dates);

    /**
     * 批量插入功能
     * @param stockRtInfoList
     */
    int insertBatch(List<StockRtInfo> stockRtInfoList);
}